mdcmsfandomcom-20200214-history
Creating templates
This file will give help you with building templates for mdCMS. This is used as reference to create own themes. Please note that this is only for mdCMS templates. All references on this page are only used in mdCMS. If you want to use the mdCMS template system in your own projects please refer to LINK HERE BLABLA. This document may also be important if you want to create your own plugin for mdcms (CHANGE LINK NAME / URL!). In this case you should take a detailed look at the CSS reference, to make sure every plugin uses the pre defined templates for displaying errors/warnings, a menu or the pages index. All these are pre defined and should be used to make sure that a theme or template can display all that in a matching style - no matter which plugin wants to display it. Available variables mdCMS has some variables that can be shown in any template, no matter what plugins will be displayed there. One example is the title of the page. Usuallay you would put the title into the of your html file into the tag: {tpl_var::title_head} Variables for pages Filename: index.tpl "{tpl_var::title_head}" - {tpl_var::title_head} "{tpl_var::name_website}" - Name of your website "{tpl_var::title_page}" - Nam of the viewed page (for example Blog, News, Downloads...) "{tpl_var::favicon}" - filename for favicon, For the favicon you should use the example code for the favicon below! "{tpl_var::copyright_year}" - Copyright year, ex. 2008 "{tpl_var::copyright_name}" - Copyright name, your name/company/website whatever Variables for error-pages Filename: error.tpl "{tpl_var::title_head}" - {tpl_var::title_head} "{tpl_var::name_website}" - Name of your website "{tpl_var::title_page}" - Nam of the viewed page (for example Blog, News, Downloads...) "{tpl_var::favicon}" - filename for favicon, For the favicon you should use the example code for the favicon below! "{tpl_var::copyright_year}" - Copyright year, ex. 2008 "{tpl_var::copyright_name}" - Copyright name, your name/company/website whatever "{tpl_var::errormsg}" - The error message to display. mdCMS template structure mdCMS templates have to contain the plugin loops. This is where the content itself will be included. mdCMS has 4 defined plugin sizes: wide, small1, fullsize and small2. These sizes are there to make it possible for the plugin to decide if it should show the whole content (If its in fullsize for example) or if it should only give a small overview (In small1 or small2 for example). This way it can also decide to show a ticker, if its in wide. Of course you could also make wide as big as fullsize in your template, but that could give wrong results with some plugins. Thats why you should always try to keep the sizes of each position in mind. The schematic image on the right gives a good overview on how the positions where thought to be used. (Of course you can change the order of the 4 positions as you want.) CSS reference For the best template look you should use CSS files for your templates. The mdCMS BBCode defines what BBCode will be replaced by what html code. Here is the reference for your CSS files: General BBCode CSS Info: B/B, U/U, I/I, S/S will be replaced by , , , mdCMS uses to COLOR works witch Important BBCode CSS Info: Icons, smilies or IMG_ICON are created with an tag with class="icon" QUOTE will become Quote: {The quote itself} QUOTE=Username will be Original by Username {The quote itself} CODE will be replaced by Code: {The code} Plugin CSS Info: Plugins use (BBCode HIGHLIGHT) to highlight texts, (BBCode ERROR) to display errors, (BBCode SUCCESS) to show successfull operations. Detailed Plugin CSS Info: Plugins that want to show a Menu or graphical buttons use in a with the class="button" ( Example ) Detailed Informations (For example News) are displayed using this code: {DATE} {HEADLINE} {MAIN TEXT} {MORE TEXT} {FURTHER INFO} Smaller Informations (For example Search results) are displayed with this code: {HEADLINE} {THE TEXT} If a plugin has multiple pages it will use this code to display: Page 2 of 4 1 2 3 4 (In this example page 2 is viewed) Code samples {tpl_if::(favicon)::!=::(_nothing)} {tpl_endif} etc....